<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>利用less实现换肤</title>
  <link rel="stylesheet/less" href="index.less">
</head>
<body class="style0">
<h2>利用less实现换肤</h2>
<input type="color">
<script src="https://cdn.bootcss.com/less.js/3.9.0/less.min.js"></script>
<script>
  var myColor = document.getElementsByTagName('input')[0]
  myColor.onchange=function (e) {
    custome(e.target.value)
  }
  function custome (color) {
    less.modifyVars({
      '@backgroundColor': color,
    });
  }
</script>
</body>
</html>
